package gdut.imis.controller;

import gdut.imis.Utils.Result;
import gdut.imis.domain.MatchesTeamMembersRel;
import gdut.imis.service.MatchesTeamMembersRelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author JiaFu
 * @Date 2023/4/8 19:05
 */
@RestController
@RequestMapping("/matches-team-members-rel")
@Api(value = "比赛队伍与学生关联接口", tags = {"比赛队伍与学生关联接口"})
@RequiredArgsConstructor
public class MatchesTeamMembersRelController extends BaseController {
    private final MatchesTeamMembersRelService matchesTeamMembersRelService;

    @ApiOperation("新增比赛队伍与学生关联")
    @PostMapping("/addTeamsStudentRel")
    @PreAuthorize("@cp.hasPermission('matchesTeamMembersRel')")
    public Result addTeamsStudentRel(@RequestBody MatchesTeamMembersRel matchesTeamMembersRel) {
        return matchesTeamMembersRelService.addTeamsStudentRel(matchesTeamMembersRel);
    }

}
